package cn.rgb.orm.config;

import java.util.HashMap;
import java.util.Map;

public class SqlMapping {

	protected String namespace;
	protected Map<String, String> aliasTypeMap = new HashMap<String, String>();
	protected Map<String, ResultMapping> resultMap = new HashMap<String, ResultMapping>();
	protected Map<String, SqlOperateMapping> sqlOperMap = new HashMap<String, SqlOperateMapping>();
	
	public String getNamespace() {
		return namespace;
	}

	public void setNamespace(String namespace) {
		this.namespace = namespace;
	}

	public SqlOperateMapping getSqlOprate(String id) {
		return sqlOperMap.get(id);
	}
	
	public void putAlias(String alias, String type) {
		aliasTypeMap.put(alias, type);
	}
	
	public void addResultMapping(ResultMapping resultMapping) {
		this.resultMap.put(resultMapping.getId(), resultMapping);
	}
	
	public ResultMapping getResultMapping(String id) {
		return this.resultMap.get(id);
	}
	
	public void addSqlOperateMapping(SqlOperateMapping sqlOperMapping) {
		this.sqlOperMap.put(sqlOperMapping.getId(), sqlOperMapping);
	}
	
	public String getClassByAlias(String alias) {
		return this.aliasTypeMap.get(alias);
	}
}
